/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package czStvDpds.graphics3D.gui;

/**
 *
 * @author Ondra
 */
public class ComponentRelativeSize {
    private float heightRel, widthRel;

    public ComponentRelativeSize(float height, float width) {
        this.heightRel = height;
        this.widthRel = width;
    }

    public float getHeight() {
        return heightRel;
    }

    public void setHeight(float height) {
        this.heightRel = height;
    }

    public float getWidth() {
        return widthRel;
    }

    public void setWidth(float width) {
        this.widthRel = width;
    }
    
    public ComponentRelativeSize max(ComponentRelativeSize size2){
        float height = Math.max(this.heightRel, size2.getHeight());
        float width = Math.max(this.widthRel, size2.getWidth());
        return new ComponentRelativeSize(height, width);
    }

    public boolean equals(ComponentRelativeSize size2) {
        return heightRel == size2.getHeight() && widthRel == size2.getWidth();
    }

    public ComponentPixelSize getPixelSize() {
        return new ComponentPixelSize(Modeler.ratioToPixels(heightRel), Modeler.ratioToPixels(widthRel));
    }
    
}
